/******/ (() => { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ "./apps/ms-auth/config/index.ts":
/*!**************************************!*\
  !*** ./apps/ms-auth/config/index.ts ***!
  \**************************************/
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
const envMap = {
    dev: {
        serviceId: "auth_1",
        serviceName: 'auth',
        ip: "127.0.0.1",
        port: 3001,
        secretOrPrivateKey: "dev",
    },
    test: {
        serviceId: "auth_1",
        serviceName: 'auth',
        ip: "127.0.0.1",
        port: 3001,
        secretOrPrivateKey: "test",
    },
    prod: {
        serviceId: "auth_1",
        serviceName: 'auth',
        ip: "127.0.0.1",
        port: 3001,
        secretOrPrivateKey: "prod",
    }
};
const env = process.env.NODE_ENV.trim();
const config = envMap[env];
exports["default"] = config;


/***/ }),

/***/ "./apps/ms-auth/src/api/user.api.ts":
/*!******************************************!*\
  !*** ./apps/ms-auth/src/api/user.api.ts ***!
  \******************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const nacosNamingClient_service_1 = __webpack_require__(/*! libs/nacos/nacosNamingClient.service */ "./libs/nacos/src/nacosNamingClient.service.ts");
const actionBuilder_1 = __webpack_require__(/*! libs/common/utils/actionBuilder */ "./libs/common/src/utils/actionBuilder.ts");
let UserApi = class UserApi {
    constructor(nacosNamingClientService) {
        this.nacosNamingClientService = nacosNamingClientService;
        this.action = (0, actionBuilder_1.default)({
            timeout: 30 * 1000
        });
    }
    async getUserOneHostPath() {
        const host = await this.nacosNamingClientService.selectOneInstances({
            serviceName: 'user',
            groupName: 'DEFAULT_GROUP'
        });
        const path = 'http://' + host.ip + ':' + host.port;
        return path;
    }
    async createUser(createUserDto) {
        const path = await this.getUserOneHostPath();
        return await this.action({
            method: 'POST',
            url: '/user/create',
            data: createUserDto,
            baseURL: path
        });
    }
    async getUserByEmail(email) {
        const path = await this.getUserOneHostPath();
        return await this.action({
            method: 'GET',
            url: '/user/getUserByEmail',
            params: {
                email
            },
            baseURL: path
        });
    }
    async getRoleKeysByUserId(userId) {
        const path = await this.getUserOneHostPath();
        return await this.action({
            method: 'GET',
            url: '/user/getRoleKeysByUserId',
            params: {
                userId
            },
            baseURL: path
        });
    }
};
UserApi = __decorate([
    (0, common_1.Injectable)(),
    __metadata("design:paramtypes", [typeof (_a = typeof nacosNamingClient_service_1.NacosNamingClientService !== "undefined" && nacosNamingClient_service_1.NacosNamingClientService) === "function" ? _a : Object])
], UserApi);
exports["default"] = UserApi;


/***/ }),

/***/ "./apps/ms-auth/src/common/enum/RoleKey.ts":
/*!*************************************************!*\
  !*** ./apps/ms-auth/src/common/enum/RoleKey.ts ***!
  \*************************************************/
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
var RoleKey;
(function (RoleKey) {
    RoleKey["COMMON_USER"] = "COMMON_USER";
    RoleKey["ADMIN"] = "ADMIN";
})(RoleKey || (RoleKey = {}));
exports["default"] = RoleKey;


/***/ }),

/***/ "./apps/ms-auth/src/controller/api.controller.ts":
/*!*******************************************************!*\
  !*** ./apps/ms-auth/src/controller/api.controller.ts ***!
  \*******************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a, _b, _c;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const R_1 = __webpack_require__(/*! libs/common/utils/R */ "./libs/common/src/utils/R.ts");
const CreateApiDto_1 = __webpack_require__(/*! ../dto/CreateApiDto */ "./apps/ms-auth/src/dto/CreateApiDto.ts");
const api_service_1 = __webpack_require__(/*! ../service/api.service */ "./apps/ms-auth/src/service/api.service.ts");
let ApiController = class ApiController {
    constructor(apiService) {
        this.apiService = apiService;
    }
    async create(createApiDto) {
        await this.apiService.create(createApiDto);
        return R_1.default.ok();
    }
};
__decorate([
    (0, common_1.Post)('/create'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_b = typeof CreateApiDto_1.default !== "undefined" && CreateApiDto_1.default) === "function" ? _b : Object]),
    __metadata("design:returntype", typeof (_c = typeof Promise !== "undefined" && Promise) === "function" ? _c : Object)
], ApiController.prototype, "create", null);
ApiController = __decorate([
    (0, common_1.Controller)('/api'),
    __metadata("design:paramtypes", [typeof (_a = typeof api_service_1.default !== "undefined" && api_service_1.default) === "function" ? _a : Object])
], ApiController);
exports["default"] = ApiController;


/***/ }),

/***/ "./apps/ms-auth/src/controller/auth.controller.ts":
/*!********************************************************!*\
  !*** ./apps/ms-auth/src/controller/auth.controller.ts ***!
  \********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const auth_service_1 = __webpack_require__(/*! ../service/auth.service */ "./apps/ms-auth/src/service/auth.service.ts");
const LoginDto_1 = __webpack_require__(/*! ../dto/LoginDto */ "./apps/ms-auth/src/dto/LoginDto.ts");
const R_1 = __webpack_require__(/*! libs/common/utils/R */ "./libs/common/src/utils/R.ts");
const RegisterDto_1 = __webpack_require__(/*! ../dto/RegisterDto */ "./apps/ms-auth/src/dto/RegisterDto.ts");
const AuthTokenDto_1 = __webpack_require__(/*! ../dto/AuthTokenDto */ "./apps/ms-auth/src/dto/AuthTokenDto.ts");
const EmailDto_1 = __webpack_require__(/*! ../dto/EmailDto */ "./apps/ms-auth/src/dto/EmailDto.ts");
let MsAuthController = class MsAuthController {
    constructor(authService) {
        this.authService = authService;
    }
    async applyToJoin(registerDto) {
        const authToken = await this.authService.applyToJoin(registerDto);
        return R_1.default.ok(authToken);
    }
    async register(registerDto) {
        const userId = await this.authService.register(registerDto);
        return R_1.default.ok(userId);
    }
    async login(loginDto) {
        const authToken = await this.authService.login(loginDto);
        return R_1.default.ok(authToken);
    }
    async validateIdentity(data) {
        return R_1.default.ok(true);
    }
    async getLoginCode(emailDto) {
        await this.authService.getLoginCode(emailDto.email);
        return R_1.default.ok();
    }
    async getRegisterCode(emailDto) {
        await this.authService.getRegisterCode(emailDto.email);
        return R_1.default.ok();
    }
    async validateToken(token) {
        const data = this.authService.validateToken(token);
        return R_1.default.ok(data);
    }
    async validateRefToken(refToken) {
        const data = this.authService.validateRefToken(refToken);
        return R_1.default.ok(data);
    }
    async refreshToken(authTokenDto) {
        const data = this.authService.refreshToken(authTokenDto.token, authTokenDto.refToken);
        return R_1.default.ok(data);
    }
};
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/applyToJoin'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_b = typeof RegisterDto_1.default !== "undefined" && RegisterDto_1.default) === "function" ? _b : Object]),
    __metadata("design:returntype", typeof (_c = typeof Promise !== "undefined" && Promise) === "function" ? _c : Object)
], MsAuthController.prototype, "applyToJoin", null);
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/register'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_d = typeof RegisterDto_1.default !== "undefined" && RegisterDto_1.default) === "function" ? _d : Object]),
    __metadata("design:returntype", typeof (_e = typeof Promise !== "undefined" && Promise) === "function" ? _e : Object)
], MsAuthController.prototype, "register", null);
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/login'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_f = typeof LoginDto_1.default !== "undefined" && LoginDto_1.default) === "function" ? _f : Object]),
    __metadata("design:returntype", typeof (_g = typeof Promise !== "undefined" && Promise) === "function" ? _g : Object)
], MsAuthController.prototype, "login", null);
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/validateIdentity'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", typeof (_h = typeof Promise !== "undefined" && Promise) === "function" ? _h : Object)
], MsAuthController.prototype, "validateIdentity", null);
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/getLoginCode'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_j = typeof EmailDto_1.default !== "undefined" && EmailDto_1.default) === "function" ? _j : Object]),
    __metadata("design:returntype", typeof (_k = typeof Promise !== "undefined" && Promise) === "function" ? _k : Object)
], MsAuthController.prototype, "getLoginCode", null);
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/getRegisterCode'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_l = typeof EmailDto_1.default !== "undefined" && EmailDto_1.default) === "function" ? _l : Object]),
    __metadata("design:returntype", typeof (_m = typeof Promise !== "undefined" && Promise) === "function" ? _m : Object)
], MsAuthController.prototype, "getRegisterCode", null);
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/validateToken'),
    __param(0, (0, common_1.Body)('token')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", typeof (_o = typeof Promise !== "undefined" && Promise) === "function" ? _o : Object)
], MsAuthController.prototype, "validateToken", null);
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/validateRefToken'),
    __param(0, (0, common_1.Body)('refToken')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", typeof (_p = typeof Promise !== "undefined" && Promise) === "function" ? _p : Object)
], MsAuthController.prototype, "validateRefToken", null);
__decorate([
    (0, common_1.HttpCode)(200),
    (0, common_1.Post)('/refreshToken'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_q = typeof AuthTokenDto_1.default !== "undefined" && AuthTokenDto_1.default) === "function" ? _q : Object]),
    __metadata("design:returntype", typeof (_r = typeof Promise !== "undefined" && Promise) === "function" ? _r : Object)
], MsAuthController.prototype, "refreshToken", null);
MsAuthController = __decorate([
    (0, common_1.Controller)('/auth'),
    __metadata("design:paramtypes", [typeof (_a = typeof auth_service_1.default !== "undefined" && auth_service_1.default) === "function" ? _a : Object])
], MsAuthController);
exports["default"] = MsAuthController;


/***/ }),

/***/ "./apps/ms-auth/src/controller/role.controller.ts":
/*!********************************************************!*\
  !*** ./apps/ms-auth/src/controller/role.controller.ts ***!
  \********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a, _b, _c, _d, _e, _f;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const role_service_1 = __webpack_require__(/*! ../service/role.service */ "./apps/ms-auth/src/service/role.service.ts");
const R_1 = __webpack_require__(/*! libs/common/utils/R */ "./libs/common/src/utils/R.ts");
const CreateRoleDto_1 = __webpack_require__(/*! ../dto/CreateRoleDto */ "./apps/ms-auth/src/dto/CreateRoleDto.ts");
let RoleController = class RoleController {
    constructor(roleService) {
        this.roleService = roleService;
    }
    async create(createRoleDto) {
        await this.roleService.create(createRoleDto);
        return R_1.default.ok();
    }
    async getRoleByRoleIds(roleIds) {
        let res = await this.roleService.getRoleByRoleIds(roleIds);
        return R_1.default.ok(res);
    }
    async getRoleByKey(roleKey) {
        const res = await this.roleService.getRoleByKey(roleKey);
        return R_1.default.ok(res);
    }
    async getRoleById(roleId) {
        const res = await this.roleService.getRoleById(roleId);
        return R_1.default.ok(res);
    }
};
__decorate([
    (0, common_1.Post)('/create'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [typeof (_b = typeof CreateRoleDto_1.default !== "undefined" && CreateRoleDto_1.default) === "function" ? _b : Object]),
    __metadata("design:returntype", typeof (_c = typeof Promise !== "undefined" && Promise) === "function" ? _c : Object)
], RoleController.prototype, "create", null);
__decorate([
    (0, common_1.Post)('/getRoleByRoleIds'),
    __param(0, (0, common_1.Body)('roleIds')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Array]),
    __metadata("design:returntype", typeof (_d = typeof Promise !== "undefined" && Promise) === "function" ? _d : Object)
], RoleController.prototype, "getRoleByRoleIds", null);
__decorate([
    (0, common_1.Post)('/getRoleByKey'),
    __param(0, (0, common_1.Body)('roleKey')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", typeof (_e = typeof Promise !== "undefined" && Promise) === "function" ? _e : Object)
], RoleController.prototype, "getRoleByKey", null);
__decorate([
    (0, common_1.Post)('/getRoleById'),
    __param(0, (0, common_1.Body)('roleId')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", typeof (_f = typeof Promise !== "undefined" && Promise) === "function" ? _f : Object)
], RoleController.prototype, "getRoleById", null);
RoleController = __decorate([
    (0, common_1.Controller)('/role'),
    __metadata("design:paramtypes", [typeof (_a = typeof role_service_1.default !== "undefined" && role_service_1.default) === "function" ? _a : Object])
], RoleController);
exports["default"] = RoleController;


/***/ }),

/***/ "./apps/ms-auth/src/dto/AuthTokenDto.ts":
/*!**********************************************!*\
  !*** ./apps/ms-auth/src/dto/AuthTokenDto.ts ***!
  \**********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator");
class AuthTokenDto {
}
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], AuthTokenDto.prototype, "token", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], AuthTokenDto.prototype, "refToken", void 0);
exports["default"] = AuthTokenDto;


/***/ }),

/***/ "./apps/ms-auth/src/dto/CreateApiDto.ts":
/*!**********************************************!*\
  !*** ./apps/ms-auth/src/dto/CreateApiDto.ts ***!
  \**********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator");
class CreateApiDto {
}
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], CreateApiDto.prototype, "name", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], CreateApiDto.prototype, "keyword", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateApiDto.prototype, "describe", void 0);
exports["default"] = CreateApiDto;


/***/ }),

/***/ "./apps/ms-auth/src/dto/CreateRoleDto.ts":
/*!***********************************************!*\
  !*** ./apps/ms-auth/src/dto/CreateRoleDto.ts ***!
  \***********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator");
class CreateRoleDto {
}
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], CreateRoleDto.prototype, "name", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], CreateRoleDto.prototype, "keyword", void 0);
__decorate([
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", typeof (_a = typeof Array !== "undefined" && Array) === "function" ? _a : Object)
], CreateRoleDto.prototype, "apis", void 0);
exports["default"] = CreateRoleDto;


/***/ }),

/***/ "./apps/ms-auth/src/dto/EmailDto.ts":
/*!******************************************!*\
  !*** ./apps/ms-auth/src/dto/EmailDto.ts ***!
  \******************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator");
class EmailDto {
}
__decorate([
    (0, class_validator_1.IsEmail)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], EmailDto.prototype, "email", void 0);
exports["default"] = EmailDto;


/***/ }),

/***/ "./apps/ms-auth/src/dto/LoginDto.ts":
/*!******************************************!*\
  !*** ./apps/ms-auth/src/dto/LoginDto.ts ***!
  \******************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator");
class LoginDto {
}
__decorate([
    (0, class_validator_1.IsEmail)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], LoginDto.prototype, "email", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.Length)(6),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], LoginDto.prototype, "code", void 0);
exports["default"] = LoginDto;


/***/ }),

/***/ "./apps/ms-auth/src/dto/RegisterDto.ts":
/*!*********************************************!*\
  !*** ./apps/ms-auth/src/dto/RegisterDto.ts ***!
  \*********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const class_validator_1 = __webpack_require__(/*! class-validator */ "class-validator");
class RegisterDto {
}
__decorate([
    (0, class_validator_1.IsEmail)(),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], RegisterDto.prototype, "email", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.Length)(6),
    (0, class_validator_1.IsNotEmpty)(),
    __metadata("design:type", String)
], RegisterDto.prototype, "code", void 0);
exports["default"] = RegisterDto;


/***/ }),

/***/ "./apps/ms-auth/src/entity/api.entity.ts":
/*!***********************************************!*\
  !*** ./apps/ms-auth/src/entity/api.entity.ts ***!
  \***********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let Api = class Api {
};
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], Api.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)('varchar'),
    __metadata("design:type", String)
], Api.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)('varchar'),
    __metadata("design:type", String)
], Api.prototype, "keyword", void 0);
__decorate([
    (0, typeorm_1.Column)('varchar'),
    __metadata("design:type", String)
], Api.prototype, "describe", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", String)
], Api.prototype, "createTime", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", String)
], Api.prototype, "updateTime", void 0);
__decorate([
    (0, typeorm_1.VersionColumn)(),
    __metadata("design:type", Number)
], Api.prototype, "version", void 0);
Api = __decorate([
    (0, typeorm_1.Entity)({
        name: 't_api',
    })
], Api);
exports["default"] = Api;


/***/ }),

/***/ "./apps/ms-auth/src/entity/role.entity.ts":
/*!************************************************!*\
  !*** ./apps/ms-auth/src/entity/role.entity.ts ***!
  \************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const typeorm_1 = __webpack_require__(/*! typeorm */ "typeorm");
let Role = class Role {
};
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], Role.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.Column)('varchar'),
    __metadata("design:type", String)
], Role.prototype, "name", void 0);
__decorate([
    (0, typeorm_1.Column)('varchar', {
        default: '',
    }),
    __metadata("design:type", String)
], Role.prototype, "describe", void 0);
__decorate([
    (0, typeorm_1.Column)('varchar'),
    __metadata("design:type", String)
], Role.prototype, "keyword", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", String)
], Role.prototype, "createTime", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", String)
], Role.prototype, "updateTime", void 0);
__decorate([
    (0, typeorm_1.VersionColumn)(),
    __metadata("design:type", Number)
], Role.prototype, "version", void 0);
Role = __decorate([
    (0, typeorm_1.Entity)({
        name: 't_role',
    })
], Role);
exports["default"] = Role;


/***/ }),

/***/ "./apps/ms-auth/src/ms-auth.module.ts":
/*!********************************************!*\
  !*** ./apps/ms-auth/src/ms-auth.module.ts ***!
  \********************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.MsAuthModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const auth_controller_1 = __webpack_require__(/*! ./controller/auth.controller */ "./apps/ms-auth/src/controller/auth.controller.ts");
const auth_service_1 = __webpack_require__(/*! ./service/auth.service */ "./apps/ms-auth/src/service/auth.service.ts");
const email_service_1 = __webpack_require__(/*! ./service/email.service */ "./apps/ms-auth/src/service/email.service.ts");
const ioredis_1 = __webpack_require__(/*! @nestjs-modules/ioredis */ "@nestjs-modules/ioredis");
const GlobalException_filter_1 = __webpack_require__(/*! libs/common/filters/GlobalException.filter */ "./libs/common/src/filters/GlobalException.filter.ts");
const nacos_module_1 = __webpack_require__(/*! libs/nacos/nacos.module */ "./libs/nacos/src/nacos.module.ts");
const nacos_1 = __webpack_require__(/*! config/nacos */ "./config/nacos.ts");
const nacosNamingClient_service_1 = __webpack_require__(/*! libs/nacos/nacosNamingClient.service */ "./libs/nacos/src/nacosNamingClient.service.ts");
const nacosConfigClient_service_1 = __webpack_require__(/*! libs/nacos/nacosConfigClient.service */ "./libs/nacos/src/nacosConfigClient.service.ts");
const config_1 = __webpack_require__(/*! ../config */ "./apps/ms-auth/config/index.ts");
const user_api_1 = __webpack_require__(/*! ./api/user.api */ "./apps/ms-auth/src/api/user.api.ts");
const role_controller_1 = __webpack_require__(/*! ./controller/role.controller */ "./apps/ms-auth/src/controller/role.controller.ts");
const api_controller_1 = __webpack_require__(/*! ./controller/api.controller */ "./apps/ms-auth/src/controller/api.controller.ts");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const api_entity_1 = __webpack_require__(/*! ./entity/api.entity */ "./apps/ms-auth/src/entity/api.entity.ts");
const role_entity_1 = __webpack_require__(/*! ./entity/role.entity */ "./apps/ms-auth/src/entity/role.entity.ts");
const role_service_1 = __webpack_require__(/*! ./service/role.service */ "./apps/ms-auth/src/service/role.service.ts");
const api_service_1 = __webpack_require__(/*! ./service/api.service */ "./apps/ms-auth/src/service/api.service.ts");
const nacos_2 = __webpack_require__(/*! nacos */ "nacos");
let MsAuthModule = class MsAuthModule {
    constructor(nacosNamingClientService) {
        this.nacosNamingClientService = nacosNamingClientService;
        nacosNamingClientService.registerInstance({
            serviceName: config_1.default.serviceName,
            instance: {
                ip: config_1.default.ip,
                port: config_1.default.port,
                instanceId: config_1.default.serviceId,
                healthy: true,
                enabled: true,
            }
        });
    }
};
exports.MsAuthModule = MsAuthModule;
exports.MsAuthModule = MsAuthModule = __decorate([
    (0, common_1.Module)({
        imports: [
            nacos_module_1.NacosModule.forRoot({
                clientOptions: {
                    serverAddr: nacos_1.default.url,
                    namespace: nacos_1.default.namespace,
                },
                nacosNamingClientConfig: {
                    logger: console,
                    serverList: nacos_1.default.url,
                    namespace: nacos_1.default.namespace,
                }
            }),
            ioredis_1.RedisModule.forRootAsync({
                imports: [nacos_module_1.NacosModule],
                inject: [nacos_2.NacosConfigClient, nacosConfigClient_service_1.NacosConfigClientService],
                useFactory: async (nacosConfigClientService) => {
                    console.log(nacosConfigClientService);
                    const redisConfig = await nacosConfigClientService.getConfig('redis', 'DEFAULT_GROUP');
                    return {
                        url: redisConfig.url,
                        options: {
                            db: redisConfig.db,
                            password: redisConfig.password,
                        },
                        type: 'single',
                    };
                }
            }),
            typeorm_1.TypeOrmModule.forRootAsync({
                imports: [nacos_module_1.NacosModule],
                inject: [nacos_2.NacosConfigClient, nacosConfigClient_service_1.NacosConfigClientService],
                useFactory: async (nacosConfigClientService) => {
                    const mySqlConfig = await nacosConfigClientService.getConfig('mysql', 'DEFAULT_GROUP');
                    return {
                        type: 'mysql',
                        host: mySqlConfig.host,
                        port: mySqlConfig.port,
                        username: mySqlConfig.username,
                        password: mySqlConfig.password,
                        database: mySqlConfig.database,
                        entities: [api_entity_1.default, role_entity_1.default],
                        synchronize: true,
                    };
                }
            }),
            typeorm_1.TypeOrmModule.forFeature([api_entity_1.default, role_entity_1.default])
        ],
        controllers: [auth_controller_1.default, role_controller_1.default, api_controller_1.default],
        providers: [
            user_api_1.default,
            role_service_1.default,
            api_service_1.default,
            auth_service_1.default,
            email_service_1.default,
            GlobalException_filter_1.GlobalExceptionFilter
        ],
    }),
    __metadata("design:paramtypes", [typeof (_a = typeof nacosNamingClient_service_1.NacosNamingClientService !== "undefined" && nacosNamingClient_service_1.NacosNamingClientService) === "function" ? _a : Object])
], MsAuthModule);


/***/ }),

/***/ "./apps/ms-auth/src/service/api.service.ts":
/*!*************************************************!*\
  !*** ./apps/ms-auth/src/service/api.service.ts ***!
  \*************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const typeorm_2 = __webpack_require__(/*! typeorm */ "typeorm");
const api_entity_1 = __webpack_require__(/*! ../entity/api.entity */ "./apps/ms-auth/src/entity/api.entity.ts");
let ApiService = class ApiService {
    constructor(apiRepoitory) {
        this.apiRepoitory = apiRepoitory;
    }
    async create(api) {
        const apiEntity = await this.apiRepoitory.save(this.apiRepoitory.create({
            keyword: api.keyword,
            name: api.name,
            describe: api.describe
        }));
        return apiEntity.id;
    }
};
ApiService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(api_entity_1.default)),
    __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object])
], ApiService);
exports["default"] = ApiService;


/***/ }),

/***/ "./apps/ms-auth/src/service/auth.service.ts":
/*!**************************************************!*\
  !*** ./apps/ms-auth/src/service/auth.service.ts ***!
  \**************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var AuthService_1;
var _a, _b, _c;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const jwt = __webpack_require__(/*! jsonwebtoken */ "jsonwebtoken");
const config_1 = __webpack_require__(/*! ../../config */ "./apps/ms-auth/config/index.ts");
const BusinessError_1 = __webpack_require__(/*! libs/common/utils/BusinessError */ "./libs/common/src/utils/BusinessError.ts");
const ioredis_1 = __webpack_require__(/*! @nestjs-modules/ioredis */ "@nestjs-modules/ioredis");
const ioredis_2 = __webpack_require__(/*! ioredis */ "ioredis");
const email_service_1 = __webpack_require__(/*! ./email.service */ "./apps/ms-auth/src/service/email.service.ts");
const RoleKey_1 = __webpack_require__(/*! ../common/enum/RoleKey */ "./apps/ms-auth/src/common/enum/RoleKey.ts");
const user_api_1 = __webpack_require__(/*! ../api/user.api */ "./apps/ms-auth/src/api/user.api.ts");
let AuthService = AuthService_1 = class AuthService {
    constructor(redis, mailService, userApi) {
        this.redis = redis;
        this.mailService = mailService;
        this.userApi = userApi;
    }
    sign(payload) {
        return jwt.sign(payload, config_1.default.secretOrPrivateKey);
    }
    decode(token) {
        return jwt.decode(token);
    }
    async login({ email, code }) {
        const user = await this.userApi.getUserByEmail(email);
        if (!user) {
            throw new BusinessError_1.default('该人员未注册！', 400);
        }
        const status = this.validateLoginCode({
            email,
            code,
        });
        if (!status) {
            throw new BusinessError_1.default('验证码无效！', 400);
        }
        const userInfo = {
            id: user.id,
            email: email,
            name: user.name,
            roleKeys: await this.userApi.getRoleKeysByUserId(user.id),
        };
        return this.createAuthToken(userInfo);
    }
    async applyToJoin(registerDto) {
        const userId = await this.register(registerDto);
        const user = await this.userApi.getUserByEmail(registerDto.email);
        const userInfo = {
            id: userId,
            email: registerDto.email,
            name: user.name,
            roleKeys: await this.userApi.getRoleKeysByUserId(user.id),
        };
        return this.createAuthToken(userInfo);
    }
    async register(registerDto) {
        const user = await this.userApi.getUserByEmail(registerDto.email);
        if (user) {
            throw new BusinessError_1.default('该人员已注册！', 400);
        }
        const status = await this.validateRegisterCode(registerDto);
        if (!status) {
            throw new BusinessError_1.default('验证码无效！', 400);
        }
        const userInfo = {
            email: registerDto.email,
            name: '用户',
            roleKeys: [RoleKey_1.default.COMMON_USER],
        };
        const userId = await this.userApi.createUser(userInfo);
        return userId;
    }
    async validateLoginCode({ code, email }) {
        const _code = await this.redis.get(AuthService_1.loginKey + email);
        return _code === code;
    }
    async validateRegisterCode({ code, email }) {
        const _code = await this.redis.get(AuthService_1.registerKey + email);
        return _code === code;
    }
    static createCode(len) {
        let code = '';
        while (len--) {
            const str = Math.floor(Math.random() * 10);
            code += str;
        }
        return code;
    }
    async getLoginCode(email) {
        const key = AuthService_1.loginKey + email;
        await this.redis.get(key).then((data) => {
            if (data) {
                throw new BusinessError_1.default('验证码已发送，请注意查收！', 400);
            }
        });
        const user = await this.userApi.getUserByEmail(email);
        if (!user) {
            throw new BusinessError_1.default('该人员未注册！', 400);
        }
        const code = AuthService_1.createCode(6);
        await this.redis.set(key, code).then(async (data) => {
            await this.redis.expire(key, 60 * 5);
            return data;
        });
        await this.mailService.sendVerificationCode(email, code);
    }
    async getRegisterCode(email) {
        const key = AuthService_1.registerKey + email;
        await this.redis.get(key).then((data) => {
            if (data) {
                throw new BusinessError_1.default('验证码已发送，请注意查收！', 400);
            }
        });
        const user = await this.userApi.getUserByEmail(email);
        if (user) {
            throw new BusinessError_1.default('该人员已注册！', 400);
        }
        const code = AuthService_1.createCode(6);
        await this.redis.set(key, code).then(async (data) => {
            await this.redis.expire(key, 60 * 5);
            return data;
        });
        await this.mailService.sendVerificationCode(email, code);
    }
    createToken(payload) {
        return this.sign(payload);
    }
    validateToken(token) {
        return this.decode(token);
    }
    createRefToken(token) {
        return this.sign(token);
    }
    validateRefToken(refToken) {
        return this.decode(refToken);
    }
    createAuthToken(user) {
        const _token = this.createToken(user);
        return {
            token: _token,
            refToken: this.createRefToken(_token),
        };
    }
    refreshToken(token, refToken) {
        const playload = this.validateRefToken(refToken);
        if (playload === token) {
            const user = this.validateToken(token);
            return this.createAuthToken(user);
        }
    }
};
AuthService.loginKey = 'login_';
AuthService.registerKey = 'register_';
AuthService = AuthService_1 = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, ioredis_1.InjectRedis)()),
    __metadata("design:paramtypes", [typeof (_a = typeof ioredis_2.Redis !== "undefined" && ioredis_2.Redis) === "function" ? _a : Object, typeof (_b = typeof email_service_1.default !== "undefined" && email_service_1.default) === "function" ? _b : Object, typeof (_c = typeof user_api_1.default !== "undefined" && user_api_1.default) === "function" ? _c : Object])
], AuthService);
exports["default"] = AuthService;


/***/ }),

/***/ "./apps/ms-auth/src/service/email.service.ts":
/*!***************************************************!*\
  !*** ./apps/ms-auth/src/service/email.service.ts ***!
  \***************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const email_1 = __webpack_require__(/*! config/email */ "./config/email.ts");
const nodemailer = __webpack_require__(/*! nodemailer */ "nodemailer");
let MailService = class MailService {
    constructor() {
        this.transporter = nodemailer.createTransport({
            host: 'smtp.qq.com',
            port: 465,
            secure: true,
            auth: {
                user: email_1.default.email,
                pass: email_1.default.authKey,
            },
        });
    }
    async sendVerificationCode(email, code) {
        const mailOptions = {
            from: email_1.default.email,
            to: email,
            subject: '验证码',
            text: `您的验证码是: ${code}`,
        };
        await this.transporter.sendMail(mailOptions);
    }
};
MailService = __decorate([
    (0, common_1.Injectable)(),
    __metadata("design:paramtypes", [])
], MailService);
exports["default"] = MailService;


/***/ }),

/***/ "./apps/ms-auth/src/service/role.service.ts":
/*!**************************************************!*\
  !*** ./apps/ms-auth/src/service/role.service.ts ***!
  \**************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const typeorm_1 = __webpack_require__(/*! @nestjs/typeorm */ "@nestjs/typeorm");
const typeorm_2 = __webpack_require__(/*! typeorm */ "typeorm");
const role_entity_1 = __webpack_require__(/*! ../entity/role.entity */ "./apps/ms-auth/src/entity/role.entity.ts");
let RoleService = class RoleService {
    constructor(roleRepoitory) {
        this.roleRepoitory = roleRepoitory;
    }
    async getRoleByRoleIds(roleIds) {
        return await this.roleRepoitory.find({
            where: { id: (0, typeorm_2.In)(roleIds) },
        });
    }
    async create(role) {
        const roleEntity = await this.roleRepoitory.save(this.roleRepoitory.create({
            keyword: role.keyword,
            name: role.name,
        }));
        return roleEntity.id;
    }
    async getRoleByKey(roleKey) {
        return await this.roleRepoitory.findOne({
            where: { keyword: roleKey },
        });
    }
    async getRoleById(roleId) {
        return await this.roleRepoitory.findOne({
            where: { id: roleId },
        });
    }
};
RoleService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, typeorm_1.InjectRepository)(role_entity_1.default)),
    __metadata("design:paramtypes", [typeof (_a = typeof typeorm_2.Repository !== "undefined" && typeorm_2.Repository) === "function" ? _a : Object])
], RoleService);
exports["default"] = RoleService;


/***/ }),

/***/ "./config/email.ts":
/*!*************************!*\
  !*** ./config/email.ts ***!
  \*************************/
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
const envMap = {
    dev: {
        email: '1667171520@qq.com',
        authKey: 'vlbhvrqiwzemcfed',
    },
    test: {
        email: '1667171520@qq.com',
        authKey: 'vlbhvrqiwzemcfed',
    },
    prod: {
        email: '1667171520@qq.com',
        authKey: 'vlbhvrqiwzemcfed',
    },
};
const config = envMap[process.env.NODE_ENV.trim()];
exports["default"] = config;


/***/ }),

/***/ "./config/nacos.ts":
/*!*************************!*\
  !*** ./config/nacos.ts ***!
  \*************************/
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
const envMap = {
    dev: {
        url: '127.0.0.1:8848',
        namespace: '95f2c1a6-1b05-4e86-af07-e409e492bfc9',
    },
    test: {
        url: '',
        namespace: '',
    },
    prod: {
        url: '',
        namespace: '',
    },
};
const config = envMap[process.env.NODE_ENV.trim()];
exports["default"] = config;


/***/ }),

/***/ "./libs/common/src/filters/GlobalException.filter.ts":
/*!***********************************************************!*\
  !*** ./libs/common/src/filters/GlobalException.filter.ts ***!
  \***********************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var GlobalExceptionFilter_1;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.GlobalExceptionFilter = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const logger_service_1 = __webpack_require__(/*! @nestjs/common/services/logger.service */ "@nestjs/common/services/logger.service");
const BusinessError_1 = __webpack_require__(/*! libs/common/utils/BusinessError */ "./libs/common/src/utils/BusinessError.ts");
let GlobalExceptionFilter = GlobalExceptionFilter_1 = class GlobalExceptionFilter {
    constructor() {
        this.logger = new logger_service_1.Logger(GlobalExceptionFilter_1.name);
    }
    catch(exception, host) {
        const ctx = host.switchToHttp();
        const response = ctx.getResponse();
        const request = ctx.getRequest();
        let message = exception?.message ||
            (Array.isArray(exception?.response?.message) ?
                (exception?.response?.message.join &&
                    exception?.response?.message?.join(','))
                : exception?.response?.message) || 'Internal server error';
        console.log('<<<<<<<<<<<<<');
        this.logger.error(new Date());
        this.logger.error(request.url);
        this.logger.error(message);
        console.log('>>>>>>>>>>>>>>');
        let status = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
        if (exception instanceof common_1.HttpException) {
            status = exception.getStatus();
            if (exception instanceof common_1.BadRequestException) {
                status = exception.getStatus();
            }
        }
        else if (exception instanceof BusinessError_1.default) {
            status = exception.code;
        }
        response.status(common_1.HttpStatus.OK).json({
            code: status,
            timestamp: new Date(),
            path: request.url,
            message,
        });
    }
};
exports.GlobalExceptionFilter = GlobalExceptionFilter;
exports.GlobalExceptionFilter = GlobalExceptionFilter = GlobalExceptionFilter_1 = __decorate([
    (0, common_1.Catch)()
], GlobalExceptionFilter);


/***/ }),

/***/ "./libs/common/src/utils/BusinessError.ts":
/*!************************************************!*\
  !*** ./libs/common/src/utils/BusinessError.ts ***!
  \************************************************/
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
class BusinessError extends Error {
    constructor(message = '服务端错误！', code = 500) {
        super(message);
        this.name = this.constructor.name;
        this.code = code;
        Error.captureStackTrace(this, BusinessError);
    }
}
exports["default"] = BusinessError;


/***/ }),

/***/ "./libs/common/src/utils/R.ts":
/*!************************************!*\
  !*** ./libs/common/src/utils/R.ts ***!
  \************************************/
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
class R {
    constructor(options) {
        this.code = options.code;
        this.message = options.message;
        this.data = options?.data;
    }
    static ok(data) {
        return new R({
            code: 200,
            message: '请求成功！',
            data,
        });
    }
    static error(message) {
        return new R({
            code: 500,
            message,
        });
    }
}
exports["default"] = R;


/***/ }),

/***/ "./libs/common/src/utils/actionBuilder.ts":
/*!************************************************!*\
  !*** ./libs/common/src/utils/actionBuilder.ts ***!
  \************************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const axios_1 = __webpack_require__(/*! axios */ "axios");
const actionBuilder = (axiosConfig) => {
    const action = axios_1.default.create(axiosConfig);
    action.interceptors.request.use((config) => {
        return config;
    }, (error) => {
        return Promise.reject(error);
    });
    action.interceptors.response.use((res) => {
        if (res.status == common_1.HttpStatus.OK) {
            if (res.data.code === 200) {
                return Promise.resolve(res.data.data);
            }
            return Promise.reject(res.data.message);
        }
        return Promise.reject(res);
    }, (error) => {
        return Promise.reject(error);
    });
    return action.request;
};
exports["default"] = actionBuilder;


/***/ }),

/***/ "./libs/nacos/src/nacos.module.ts":
/*!****************************************!*\
  !*** ./libs/nacos/src/nacos.module.ts ***!
  \****************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var NacosModule_1;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NacosModule = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const nacosNamingClient_service_1 = __webpack_require__(/*! ./nacosNamingClient.service */ "./libs/nacos/src/nacosNamingClient.service.ts");
const nacosConfigClient_service_1 = __webpack_require__(/*! ./nacosConfigClient.service */ "./libs/nacos/src/nacosConfigClient.service.ts");
const nacos_1 = __webpack_require__(/*! nacos */ "nacos");
let NacosModule = NacosModule_1 = class NacosModule {
    static forRoot(options) {
        const providers = [
            {
                provide: 'NacosOptions',
                useValue: options,
            },
            {
                provide: 'NacosConfigClient',
                useFactory: (options) => {
                    return new nacos_1.NacosConfigClient(options.clientOptions);
                },
                inject: ['NacosOptions'],
            },
            {
                provide: 'NacosNamingClient',
                useFactory: (options) => {
                    return new nacos_1.NacosNamingClient(options.nacosNamingClientConfig);
                },
                inject: ['NacosOptions'],
            },
            nacosConfigClient_service_1.NacosConfigClientService,
            nacosNamingClient_service_1.NacosNamingClientService,
        ];
        return {
            module: NacosModule_1,
            providers,
            exports: [
                'NacosConfigClient',
                'NacosNamingClient',
                nacosConfigClient_service_1.NacosConfigClientService,
                nacosNamingClient_service_1.NacosNamingClientService,
            ],
        };
    }
};
exports.NacosModule = NacosModule;
exports.NacosModule = NacosModule = NacosModule_1 = __decorate([
    (0, common_1.Module)({
        providers: [nacosConfigClient_service_1.NacosConfigClientService, nacosNamingClient_service_1.NacosNamingClientService],
        exports: [nacosConfigClient_service_1.NacosConfigClientService, nacosNamingClient_service_1.NacosNamingClientService],
    })
], NacosModule);


/***/ }),

/***/ "./libs/nacos/src/nacosConfigClient.service.ts":
/*!*****************************************************!*\
  !*** ./libs/nacos/src/nacosConfigClient.service.ts ***!
  \*****************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NacosConfigClientService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const nacos_1 = __webpack_require__(/*! nacos */ "nacos");
let NacosConfigClientService = class NacosConfigClientService {
    constructor(nacosConfigClient) {
        this.nacosConfigClient = nacosConfigClient;
    }
    async getConfig(dataId, group, options) {
        try {
            const data = await this.nacosConfigClient.getConfig(dataId, group, options);
            return JSON.parse(data);
        }
        catch (e) {
            return null;
        }
    }
};
exports.NacosConfigClientService = NacosConfigClientService;
exports.NacosConfigClientService = NacosConfigClientService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, common_1.Inject)('NacosConfigClient')),
    __metadata("design:paramtypes", [typeof (_a = typeof nacos_1.NacosConfigClient !== "undefined" && nacos_1.NacosConfigClient) === "function" ? _a : Object])
], NacosConfigClientService);


/***/ }),

/***/ "./libs/nacos/src/nacosNamingClient.service.ts":
/*!*****************************************************!*\
  !*** ./libs/nacos/src/nacosNamingClient.service.ts ***!
  \*****************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {


var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
var _a;
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NacosNamingClientService = void 0;
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
const nacos_1 = __webpack_require__(/*! nacos */ "nacos");
const weightedRandomSelect_1 = __webpack_require__(/*! ./utils/weightedRandomSelect */ "./libs/nacos/src/utils/weightedRandomSelect.ts");
let NacosNamingClientService = class NacosNamingClientService {
    constructor(nacosNamingClient) {
        this.nacosNamingClient = nacosNamingClient;
    }
    async getClient() {
        return this.nacosNamingClient;
    }
    async selectOneInstances(options) {
        const hosts = await this.nacosNamingClient.selectInstances(options.serviceName, options.groupName, options.clusters, options.healthy, options.subscribe);
        const host = (0, weightedRandomSelect_1.default)(hosts);
        return host;
    }
    async registerInstance(options) {
        await this.nacosNamingClient.registerInstance(options.serviceName, options.instance, options?.groupName);
        return this.nacosNamingClient;
    }
};
exports.NacosNamingClientService = NacosNamingClientService;
exports.NacosNamingClientService = NacosNamingClientService = __decorate([
    (0, common_1.Injectable)(),
    __param(0, (0, common_1.Inject)('NacosNamingClient')),
    __metadata("design:paramtypes", [typeof (_a = typeof nacos_1.NacosNamingClient !== "undefined" && nacos_1.NacosNamingClient) === "function" ? _a : Object])
], NacosNamingClientService);


/***/ }),

/***/ "./libs/nacos/src/utils/weightedRandomSelect.ts":
/*!******************************************************!*\
  !*** ./libs/nacos/src/utils/weightedRandomSelect.ts ***!
  \******************************************************/
/***/ ((__unused_webpack_module, exports) => {


Object.defineProperty(exports, "__esModule", ({ value: true }));
function weightedRandomSelect(items) {
    if (items.length === 0) {
        return null;
    }
    let totalWeight = items.reduce((acc, item) => acc + item.weight, 0);
    const randomWeight = Math.random() * totalWeight;
    let currentWeight = 0;
    for (const item of items) {
        currentWeight += item.weight;
        if (currentWeight >= randomWeight) {
            return item;
        }
    }
    return items[items.length - 1];
}
exports["default"] = weightedRandomSelect;


/***/ }),

/***/ "@nestjs-modules/ioredis":
/*!******************************************!*\
  !*** external "@nestjs-modules/ioredis" ***!
  \******************************************/
/***/ ((module) => {

module.exports = require("@nestjs-modules/ioredis");

/***/ }),

/***/ "@nestjs/common":
/*!*********************************!*\
  !*** external "@nestjs/common" ***!
  \*********************************/
/***/ ((module) => {

module.exports = require("@nestjs/common");

/***/ }),

/***/ "@nestjs/common/services/logger.service":
/*!*********************************************************!*\
  !*** external "@nestjs/common/services/logger.service" ***!
  \*********************************************************/
/***/ ((module) => {

module.exports = require("@nestjs/common/services/logger.service");

/***/ }),

/***/ "@nestjs/core":
/*!*******************************!*\
  !*** external "@nestjs/core" ***!
  \*******************************/
/***/ ((module) => {

module.exports = require("@nestjs/core");

/***/ }),

/***/ "@nestjs/typeorm":
/*!**********************************!*\
  !*** external "@nestjs/typeorm" ***!
  \**********************************/
/***/ ((module) => {

module.exports = require("@nestjs/typeorm");

/***/ }),

/***/ "axios":
/*!************************!*\
  !*** external "axios" ***!
  \************************/
/***/ ((module) => {

module.exports = require("axios");

/***/ }),

/***/ "class-validator":
/*!**********************************!*\
  !*** external "class-validator" ***!
  \**********************************/
/***/ ((module) => {

module.exports = require("class-validator");

/***/ }),

/***/ "ioredis":
/*!**************************!*\
  !*** external "ioredis" ***!
  \**************************/
/***/ ((module) => {

module.exports = require("ioredis");

/***/ }),

/***/ "jsonwebtoken":
/*!*******************************!*\
  !*** external "jsonwebtoken" ***!
  \*******************************/
/***/ ((module) => {

module.exports = require("jsonwebtoken");

/***/ }),

/***/ "nacos":
/*!************************!*\
  !*** external "nacos" ***!
  \************************/
/***/ ((module) => {

module.exports = require("nacos");

/***/ }),

/***/ "nodemailer":
/*!*****************************!*\
  !*** external "nodemailer" ***!
  \*****************************/
/***/ ((module) => {

module.exports = require("nodemailer");

/***/ }),

/***/ "typeorm":
/*!**************************!*\
  !*** external "typeorm" ***!
  \**************************/
/***/ ((module) => {

module.exports = require("typeorm");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
(() => {
var exports = __webpack_exports__;
/*!**********************************!*\
  !*** ./apps/ms-auth/src/main.ts ***!
  \**********************************/

Object.defineProperty(exports, "__esModule", ({ value: true }));
const core_1 = __webpack_require__(/*! @nestjs/core */ "@nestjs/core");
const ms_auth_module_1 = __webpack_require__(/*! ./ms-auth.module */ "./apps/ms-auth/src/ms-auth.module.ts");
const index_1 = __webpack_require__(/*! ../config/index */ "./apps/ms-auth/config/index.ts");
const GlobalException_filter_1 = __webpack_require__(/*! libs/common/filters/GlobalException.filter */ "./libs/common/src/filters/GlobalException.filter.ts");
const common_1 = __webpack_require__(/*! @nestjs/common */ "@nestjs/common");
async function bootstrap() {
    const app = await core_1.NestFactory.create(ms_auth_module_1.MsAuthModule);
    app.useGlobalFilters(new GlobalException_filter_1.GlobalExceptionFilter());
    app.useGlobalPipes(new common_1.ValidationPipe());
    await app.listen(index_1.default.port);
    console.log(`${index_1.default.serviceName}:[http://127.0.0.1:${index_1.default.port}]`);
}
bootstrap();

})();

/******/ })()
;